<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>图标库</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    .main {
      max-width: 1346px;
      margin: 0 auto;
    }
    h1 {
      margin-top: 24px;
    }
    h2 {
      padding: 60px 0 24px;
    }
    ul {
      display: grid;
      grid-template-columns: repeat(8, 1fr);
      grid-row-gap: 36px;
      justify-content: center;
      align-items: center;
    }
    li {
      display: flex;
      flex-flow: column nowrap;
      justify-content: center;
      align-items: center;
      list-style: none;
    }
    li img {
      width: 60px;
      height: 60px;
    }
    li span {
      margin-top: 8px;
      font-size: 14px;
      line-height: 18px;
      text-align: center;
    }
  </style>
</head>
<body>
<div class="main">
  <h1>图标库</h1>
  <div class="section" id="svg">
    <h2>图标</h2>
  </div>
</div>
<script type="application/javascript">
  var renderElement = (parentElement,imageList)=>{
    var ul = document.createElement('ul');

    for (const svg of imageList) {
      var li = document.createElement('li');

      var image = document.createElement('img');
      image.src = svg.src;

      var span = document.createElement('span');
      span.innerText = svg.name;

      li.appendChild(image);
      li.appendChild(span);
      ul.appendChild(li);
    }

    parentElement.appendChild(ul);
  }
  var svgList = {{svgList}};
  renderElement(document.querySelector('#svg'),svgList);
</script>
</body>
</html>